<template>
  <div class="event-detail-page page">
    <nav-bar title="党组织信息" theme="white"></nav-bar>
    <div class="page-main" style="margin-top: 44px">
      <van-sticky class="page-scroll" :offset-top="44">
        <van-cell title="党组织信息" class="van-cell__border_top" />
        <van-cell
          title="所属区域"
          :value="persondetailData.regionAddress"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell
          title="党组织名称"
          :value="persondetailData.partyOrganizationName"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell
          title="党组织书记"
          :value="persondetailData.secretary"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell
          title="党组织联系人"
          :value="persondetailData.contacts"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell
          title="联系方式"
          :value="persondetailData.phone"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell
          title="组织类别"
          :value="persondetailData.partyOrganizationTypeName"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell
          title="党组织所在单位情况"
          :value="persondetailData.companySituationName"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell
          @click="
            $router.push(
              `/cockpit/analyse/organizationperson?partyOrganizationCode=${$route.query.partyOrganizationCode}`
            )
          "
          title="组织人数"
          :value="persondetailData.personNum"
          title-class="van-cell__title_gray"
          value-class="van-cell__value_black"
        />
        <van-cell title="单位信息" class="van-cell__border_top" />
        <div v-for="(item, index) in persondetailData.partyCompty" :key="index">
          <van-cell
            title="单位名称"
            :value="item.company_name"
            title-class="van-cell__title_gray"
            value-class="van-cell__value_black"
          />
          <van-cell
            title="党组织所在单位代码"
            :value="item.unified_credit_code"
            title-class="van-cell__title_gray"
            value-class="van-cell__value_black"
          />
          <van-cell
            title="单位类别"
            :value="item.companyTypeName"
            title-class="van-cell__title_gray"
            value-class="van-cell__value_black"
          />
          <van-cell
            title="单位建立党组织情况"
            :value="item.companyCreatOrganizationName"
            title-class="van-cell__title_gray"
            value-class="van-cell__value_black"
          />
        </div>
      </van-sticky>
    </div>
  </div>
</template>
<script>
import { mapState } from 'vuex'
import Cockpit from '@/api/cockpit'
export default {
  data() {
    return {
      persondetailData: {},
      formdata: {
        partyOrganizationCode: ''
      }
    }
  },
  computed: {
    ...mapState({
      user: state => state.userInfo
    })
  },
  created() {
    this.formdata.partyOrganizationCode = this.$route.query.partyOrganizationCode
    this.persondetail()
  },
  methods: {
    // 详情
    persondetail() {
      Cockpit.Analyse.organizationdetail(this.formdata).then(res => {
        this.persondetailData = res.data.data
      })
    }
  }
}
</script>
<style lang="less" scope>
@import '~@/assets/style/event/detail';
</style>
